home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 2 (DVD) / XENIADVD2.iso / Patch / Project Nomads / pnomads_patch2_eng.exe / MAINDIR / Run / scripts / statewatcher / powerplant.tcl < prev    next >
Encoding:
Text File  |  2002-09-29  |  5.1 KB  |  196 lines

  1. #
  2. #   Zustands-â–„berwachungs-Script
  3. #   State Watch Script
  4. #
  5. #   POWERPLANT
  6. #
  7. #   created:    15-Jun-2000 Bernd
  8. #   
  9. #   (C) COPYRIGHT 2000 RADONLABS GMBH
  10. #
  11.  
  12. proc powerplantwatch_normal {} {
  13.  
  14.     # vorerst hier unzerstoerbar. Bleibt so, bis es aufgesammelt
  15.     # (in BackPack) oder gebaut (kein Artefakt mehr) wird 
  16.     if {[.getartefactmode] == "false"} {
  17.         .announcestate house
  18.     } elseif {[.iscollected] == "true"} {
  19.         .announcestate backpack
  20.     } elseif {[.getcharges] <= 0} {
  21.         .setremoveable true
  22.     } elseif {[.getcreator] != "null"} {
  23.         .announcestate infactoryslot
  24.     }
  25. }
  26.  
  27. proc powerplantwatch_infactoryslot {} {
  28.  
  29.     # vorerst hier unzerstoerbar. Bleibt so, bis es aufgesammelt
  30.     # (in BackPack) oder gebaut (kein Artefakt mehr) wird 
  31.     if {[.getartefactmode] == "false"} {
  32.         .announcestate house
  33.     } elseif {[.iscollected] == "true"} {
  34.         .announcestate backpack
  35.     } elseif {[.getcharges] <= 0} {
  36.         .setremoveable true
  37.     } elseif {[.getcreator] == "null"} {
  38.         .announcestate normal
  39.     }
  40. }
  41.  
  42. proc powerplantwatch_bauphase {} {
  43.  
  44.     # kann zerstoert oder wieder zusammengeklappt werden
  45.     if {[.iskilled] == "true"} {
  46.         .announcestate explode
  47.     } elseif {[.getartefactmode] == "true"} {
  48.         .announcestate normal
  49.     } elseif {[.isstatetimeover] == "true"} {
  50.         .announcestate house
  51.         usersymbolicname playerpowerplant
  52.     }
  53. }
  54.  
  55.  
  56. proc powerplantwatch_house {} {
  57.  
  58.     # kann zerstoert oder wieder zusammengeklappt werden
  59.     if {[.iskilled] == "true"} {
  60.         .announcestate explode
  61.     } elseif {[.getartefactmode] == "true"} {
  62.         .announcestate normal
  63.     } elseif {[.isworking] == "true"} {
  64.         .announcestate working
  65.     } elseif {[.isoutputvehicle] == "true"} {
  66.         .announcestate outputvehicle
  67.         .setoutputvehicle false
  68.     } elseif {[.removebuilding] == "true"} {
  69.         .announcestate remove
  70.     }
  71. }
  72.  
  73. proc powerplantwatch_offline {} {
  74.  
  75.     # kann zerstoert oder wieder zusammengeklappt werden
  76.     if {[.iskilled] == "true"} {
  77.         .announcestate explode
  78.     } elseif {[.getartefactmode] == "true"} {
  79.         .announcestate normal
  80.     } elseif {[.getsleepmode] == "false"} {
  81.         .announcestate house
  82.     } elseif {[.removebuilding] == "true"} {
  83.         .announcestate remove
  84.     }
  85. }
  86.  
  87. proc powerplantwatch_working {} {
  88.  
  89.     # kann zerstoert oder wieder zusammengeklappt werden
  90.     if {[.iskilled] == "true"} {
  91.         .announcestate explode
  92.     } elseif {[.getartefactmode] == "true"} {
  93.         .announcestate normal
  94.     } elseif {[.isworking] == "false"} {
  95.         .announcestate house
  96.     } elseif {[.isoutputvehicle] == "true"} {
  97.         # denn es kann ja ein artefact gebaut werden
  98.         .announcestate outputvehicle
  99.         .setoutputvehicle false
  100.     } elseif {[.removebuilding] == "true"} {
  101.         .announcestate remove
  102.     } elseif {[.getsleepmode] == "true"} {
  103.         .announcestate offline
  104.     }
  105. }
  106.  
  107. proc powerplantwatch_explode {} {
  108.  
  109.     # Uebergang zum Artefakt oder Wegnehmen
  110.     if {[.isanimfinished] == "true"} {
  111.         if {[.getcharges] <= 0} {
  112.             .setremoveable true
  113.         } else {
  114.             .announcestate normal
  115.         .removefromisland
  116.         }
  117.     }
  118. }
  119.  
  120. proc powerplantwatch_remove {} {
  121.  
  122.     # Uebergang zum Artefakt oder Wegnehmen
  123.     if {[.isanimfinished] == "true"} {
  124.         if {[.getcharges] <= 0} {
  125.             .setremoveable true
  126.         } else {
  127.             .announcestate normal
  128.         .removefromisland
  129.         }
  130.     }
  131. }
  132.  
  133. proc powerplantwatch_backpack {} {
  134.  
  135.     # Moeglich: usgeworfen (Nicht mehr "gesammelt") oder im
  136.     # Menue gezeigt (sichtbar)
  137.     if {[.iscollected] == "false"} {
  138.         .announcestate normal
  139.     } elseif {[.isvisible] == "true"} {
  140.         .announcestate menue
  141.     }
  142. }
  143.  
  144. proc powerplantwatch_menu {} {
  145.  
  146.     if {[.isvisible] == "false"} {
  147.         .announcestate backpack
  148.     } elseif {[.getartefactuse] == "true"} {
  149.         .announcestate build
  150.     } elseif {[.iscollected] == "false"} {
  151.         .announcestate normal
  152.     }
  153. }
  154.  
  155. proc powerplantwatch_build {} {
  156.  
  157.     if {[.iskilled] == "true"} {
  158.         .announcestate explode
  159.     } elseif {[.getartefactmode] == "false"} {
  160.         .announcestate bauphase
  161.     } elseif {[.getartefactuse] == "false"} {
  162.         .announcestate backpack
  163.     }
  164. }
  165.  
  166. proc powerplantwatch_inputvehicle {} {
  167.  
  168.     # Wenn Einhol-Animation fertig ist, Zustand umschalten
  169.     if {[.iskilled] == "true"} {
  170.         .announcestate explode
  171.     } elseif {[.getartefactmode] == "true"} {
  172.         .announcestate normal
  173.     } elseif {[.isanimfinished] == "true"} {
  174.         .announcestate house
  175.     }
  176. }
  177.  
  178. proc powerplantwatch_outputvehicle {} {
  179.  
  180.     # Wenn Ausspuck-Animation fertig, wieder normalen Fabrik-Zustand
  181.     # schalten
  182.     if {[.iskilled] == "true"} {
  183.         .announcestate explode
  184.     } elseif {[.getartefactmode] == "true"} {
  185.         .announcestate normal
  186.     } elseif {[.isanimfinished] == "true"} {
  187.         .announcestate house
  188.     }
  189. }
  190.  
  191. proc powerplantwatch_cinematic {} {
  192.  
  193.     # empty
  194. }    
  195.  
  196.